package com.cn.kehong.domain;

import com.cn.kehong.utils.CommonUtil;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.List;
import java.util.Map;

public class PlanYear {
    private String id;

    private String planName;

    private String planYear;

    private String currentVersion;

    private String latestVersion;

    private String dataSource;

    private String bianzhiUser;

    private String bianzhiTime;

    private String planStatus;

    private String checkUser;

    private String checkTime;

    private String checkResult;

    private String changeUser;

    private String changeTime;

    private String createUserId;

    private String createUserName;

    private String status;

    private Date createTime;

    private Date updateTime;

    private String remark;

    private String pid;

    private int count;

    private List<PlanYearDetail> planYearDetails;

    public static final transient Map<String, String> STATUSMAP =
            ImmutableMap.of("0", "待执行", "1", "待审核", "2", "执行中", "3", "编制中", "4", "已关闭");

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getPlanName() {
        return planName;
    }

    public void setPlanName(String planName) {
        this.planName = planName == null ? null : planName.trim();
    }

    public String getPlanYear() {
        return planYear;
    }

    public void setPlanYear(String planYear) {
        this.planYear = planYear == null ? null : planYear.trim();
    }

    public String getCurrentVersion() {
        return currentVersion;
    }

    public void setCurrentVersion(String currentVersion) {
        this.currentVersion = currentVersion == null ? null : currentVersion.trim();
    }

    public String getLatestVersion() {
        return latestVersion;
    }

    public void setLatestVersion(String latestVersion) {
        this.latestVersion = latestVersion == null ? null : latestVersion.trim();
    }

    public String getDataSource() {
        return dataSource;
    }

    public void setDataSource(String dataSource) {
        this.dataSource = dataSource == null ? null : dataSource.trim();
    }

    public String getBianzhiUser() {
        return bianzhiUser;
    }

    public void setBianzhiUser(String bianzhiUser) {
        this.bianzhiUser = bianzhiUser == null ? null : bianzhiUser.trim();
    }

    public String getBianzhiTime() {
        return bianzhiTime;
    }

    public void setBianzhiTime(String bianzhiTime) {
        this.bianzhiTime = bianzhiTime == null ? null : bianzhiTime.trim();
    }

    public String getPlanStatusCn() {
        if(StringUtils.equals("5",getPlanStatus())){
            return "已驳回";
        }
        return STATUSMAP.get(getPlanStatus());
    }
    public String getPlanStatus() {
        return planStatus;
    }

    public void setPlanStatus(String planStatus) {
        this.planStatus = planStatus == null ? null : planStatus.trim();
    }

    public String getCheckUser() {
        return checkUser;
    }

    public void setCheckUser(String checkUser) {
        this.checkUser = checkUser == null ? null : checkUser.trim();
    }

    public String getCheckTime() {
        return checkTime;
    }

    public void setCheckTime(String checkTime) {
        this.checkTime = checkTime == null ? null : checkTime.trim();
    }

    public String getCheckResult() {
        return checkResult;
    }

    public void setCheckResult(String checkResult) {
        this.checkResult = checkResult == null ? null : checkResult.trim();
    }

    public String getChangeUser() {
        return changeUser;
    }

    public void setChangeUser(String changeUser) {
        this.changeUser = changeUser == null ? null : changeUser.trim();
    }

    public String getChangeTime() {
        return changeTime;
    }

    public void setChangeTime(String changeTime) {
        this.changeTime = changeTime == null ? null : changeTime.trim();
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId == null ? null : createUserId.trim();
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName == null ? null : createUserName.trim();
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid == null ? null : pid.trim();
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<PlanYearDetail> getPlanYearDetails() {
        return planYearDetails;
    }

    public void setPlanYearDetails(List<PlanYearDetail> planYearDetails) {
        this.planYearDetails = planYearDetails;
    }

    public String getCreateTimeFt(){
        String formatTime = CommonUtil.getStrTime(getCreateTime(),"yyyy-MM-dd HH:mm:ss");
        return formatTime;
    }
}